package tx.dao;

import lombok.RequiredArgsConstructor;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.UUID;

@Repository
@RequiredArgsConstructor
public class UserDao {
    final JdbcTemplate jdbcTemplate;

    public void insert() {
        String sql = "INSERT INTO `employee`(`username`,password) VALUES(?,?)";
        jdbcTemplate.update(sql, uuid(), "password");
    }

    String uuid() {
        return UUID.randomUUID().toString().substring(0, 5);
    }
}